<?php
	if(isset($_POST['timkiem']))
	{
		if(isset($_POST['timtheo']))
		{
			switch($_POST['timtheo'])
			{
				case '0':
					include './View/Product/view_timkiem_sanpham-null.php';	
				break;
				case '1':
					include './View/Product/view_timkiem_sanpham-ten.php';	
				break;
				case '2':
					include './View/Product/view_timkiem_sanpham-gia.php';	
				break;
				case '3':
					include './View/Product/view_timkiem_sanpham-nhasx.php';	
				break;
			}
		}
	}
	else
	{
		if(!isset($_GET['obj']))
		{
				include './View/view_center-trangchu.php';
		}
		if(isset($_GET['obj']))
		{
			switch($_GET['obj'])
			{
				case 'trangchu':
					include './View/view_center-trangchu.php';	
				break;
				case 'gioithieu':
					include './View/view_center-gioithieu.php';	
				break;
				case 'dichvu':
					include './View/view_center-dichvu.php';	
				break;
				case 'tintuc':
					if(isset($_GET['tt']))
						{
						  include './View/News/view_tintuc1.php';
						}
					else
						include './View/view_center-tintuc.php';		
				break;
				case 'gopy':
					include './View/view_center-gopy.php';	
				break;
				case 'dangky':
					include './View/view_center-dangky.php';	
				break;
				case 'sanpham':
					if(isset($_GET['prd']))
					{
						
						switch($_GET['prd'])
						{
							case 'apple':
								include './View/Product/view_sanpham-apple.php';
								break;
							case 'dell':
								include './View/Product/view_sanpham-dell.php';
								break;
							case 'acer':
								include './View/Product/view_sanpham-acer.php';
								break;
							case 'asus':
								include './View/Product/view_sanpham-asus.php';
								break;
							case 'sony':
								include './View/Product/view_sanpham-sony.php';
								break;
							case 'hp':
								include './View/Product/view_sanpham-hp.php';
								break;
							case 'lenovo':
								include './View/Product/view_sanpham-lenovo.php';
								break;
							case 'toshiba':
								include './View/Product/view_sanpham-toshiba.php';
								break;
							default:
								include './View/view_center-trangchu.php';	
								break;	
						}
					}
					else
						if(isset($_GET['chitiet']))
							include './View/Product/view_chitietsp.php';
						else
							include './View/view_center-trangchu.php';	
				break;
				case 'suatt':
						  include './View/view_center-suatt.php';	
					  break;
				case 'giohang':
					if(isset($_SESSION['curUser']))
					{
						if(isset($_GET['act']))
						{
							switch($_GET['act'])
							{
								case 'update':
									include './Controller/ctrl_giohang_capnhat.php';
									break;
								/*case 'delete':
									$idsp=$_GET['idsp'];
									$idsp=$_GET['iddh'];
									$kq=chitietdonhang::XoaSP($iddh,$idsp);
									
									break;*/
								//default:
									//include './View/view_center-trangchu.php';
									break;
							}
						}
						else
							include './View/view_center-giohang.php';
					}
					else
					{
						echo "<script type='text/javascript'>alert('Bạn chưa đăng nhập');</script>";
						include './View/view_center-trangchu.php';
					}
					break;
				case 'default':
					include './View/view_center-trangchu.php';	
				break;
			}	
		}
	}
?>